package chapter14;

import thinkingJava.chapter14.A;

class AnnoymouseA {
	public static A makeA() {
		return new A(){
			public void f() {
				System.out.println("public A.f()");
			}
			public void g() {
				System.out.println("public A.g()");
			}
			void u() {
				System.out.println("package A.u()");
			}
			protected void v() {
				System.out.println("protected A.v()");
			}
			private void w() {
				System.out.println("private A.w()");
			}
		};
	}
}

public class AnnoymouseImplementation {
	public static void main(String[] args) throws Exception {
		A a = AnnoymouseA.makeA();
		a.f();
		System.out.println(a.getClass().getName());
		HiddenImplementation.callHiddenMethod(a, "g");
		HiddenImplementation.callHiddenMethod(a, "u");
		HiddenImplementation.callHiddenMethod(a, "v");
		HiddenImplementation.callHiddenMethod(a, "w");
	}
}
